import React from "react";
import { CheckBox } from "devextreme-react";
import { rTimes } from "@/utils";

export const columns = [
    // {
    //     dataField: "GroupInfo",
    //     dataType: "string",
    //     caption: "组信息",
    //     width: 120,
    //     alignment: "center",
    //     groupIndex: 0
    // },
    {
        dataField: "XH",
        dataType: "string",
        caption: "分录序号",
        width: 180,
        alignment: "center",
    },
    {
        dataField: "Remarks",
        dataType: "string",
        caption: "调整说明",
        width: 140,
        alignment: "left",
        // cellRender: (cell: any) => {
        //   console.log(cell, '----celll');
        // }
    },
    {
        dataField: "ItemNames2",
        dataType: "string",
        caption: "报表项目",
        width: 140,
        alignment: "left",
    },
    {
        dataField: "KMMC",
        dataType: "string",
        caption: "科目名称",
        width: 140,
        alignment: "left",
    },
    {
        dataField: "MisName",
        dataType: "string",
        caption: "辅助账名称",
        width: 140,
        alignment: "left",
    },
    {
        dataField: "JF",
        dataType: "number",
        caption: "借方金额",
        width: 100,
        alignment: "right",
        dataTypeCustom: "money-number",
    },
    {
        dataField: "DF",
        dataType: "number",
        caption: "贷方金额",
        width: 100,
        alignment: "right",
        dataTypeCustom: "money-number",
    },
    {
        dataField: "Remark",
        dataType: "string",
        caption: "备注",
        width: 100,
        alignment: "left",
    },
    // {
    //     dataField: "isJZFL",
    //     dataType: "string",
    //     caption: "结转分录",
    //     width: 100,
    //     alignment: "center",
    //     cellRender: (cell: any) => {
    //         return <CheckBox />
    //     }
    // },
    // {
    //     dataField: "IsTZ",
    //     dataType: "string",
    //     caption: "是否调整",
    //     width: 120,
    //     alignment: "center",
    //     cellRender: (cell: any) => {
    //         if (cell.data.IsTZ === 1) {
    //             return <span>是</span>
    //         }
    //         return <span>否</span>
    //     }
    // },
    {
        dataField: "EditUser",
        dataType: "string",
        caption: "编辑人",
        width: 100,
        alignment: "center",
    },
    {
        dataField: "EditDate",
        dataType: "string",
        caption: "编辑时间",
        width: 140,
        alignment: "center",
        cellRender: (cell: any) => {
            return <span>{rTimes(cell.data.EditDate)}</span>
        }
    },
    {
        dataField: "BillType",
        dataType: "string",
        caption: "分类",
        width: 100,
        fixed: true,
        fixedPosition: 'right',
        alignment: "center",
        cellRender: (cell: any) => {
            let tempstr;
            if (cell.data.BillType === 0) {
                tempstr = '账表调整'
            } else if (cell.data.BillType === 1) {
                tempstr = '审计调整'
            }
            return < span > {tempstr}</span >
        }
    },
    // {
    //   dataField: "operation",
    //   dataType: "string",
    //   caption: "行操作",
    //   width: 100,
    //   alignment: "center",
    //   cellRender: (cell: any) => {
    //     return <CpasIcon type='icon-delete' fontSize={16} />
    //   }
    // },
]